package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementBusiElineNnipw1Mapper;
import com.ruoyi.net.domain.ElementBusiElineNnipw1;
import com.ruoyi.net.service.IElementBusiElineNnipw1Service;

/**
 * 网元-业务-eline-nni-pw基本属性Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementBusiElineNnipw1ServiceImpl implements IElementBusiElineNnipw1Service 
{
    @Autowired
    private ElementBusiElineNnipw1Mapper elementBusiElineNnipw1Mapper;

    /**
     * 查询网元-业务-eline-nni-pw基本属性
     * 
     * @param id 网元-业务-eline-nni-pw基本属性主键
     * @return 网元-业务-eline-nni-pw基本属性
     */
    @Override
    public ElementBusiElineNnipw1 selectElementBusiElineNnipw1ById(String id)
    {
        return elementBusiElineNnipw1Mapper.selectElementBusiElineNnipw1ById(id);
    }

    /**
     * 查询网元-业务-eline-nni-pw基本属性列表
     * 
     * @param elementBusiElineNnipw1 网元-业务-eline-nni-pw基本属性
     * @return 网元-业务-eline-nni-pw基本属性
     */
    @Override
    public List<ElementBusiElineNnipw1> selectElementBusiElineNnipw1List(ElementBusiElineNnipw1 elementBusiElineNnipw1)
    {
        return elementBusiElineNnipw1Mapper.selectElementBusiElineNnipw1List(elementBusiElineNnipw1);
    }

    /**
     * 新增网元-业务-eline-nni-pw基本属性
     * 
     * @param elementBusiElineNnipw1 网元-业务-eline-nni-pw基本属性
     * @return 结果
     */
    @Override
    public int insertElementBusiElineNnipw1(ElementBusiElineNnipw1 elementBusiElineNnipw1)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiElineNnipw1.getId())) {
            elementBusiElineNnipw1.setId(uuid);
        }
        elementBusiElineNnipw1.setCreateBy(SecurityUtils.getUsername());
        elementBusiElineNnipw1.setCreateTime(DateUtils.getNowDate());
        elementBusiElineNnipw1.setUpdateBy(SecurityUtils.getUsername());
        elementBusiElineNnipw1.setUpdateTime(DateUtils.getNowDate());
        return elementBusiElineNnipw1Mapper.insertElementBusiElineNnipw1(elementBusiElineNnipw1);
    }

    /**
     * 修改网元-业务-eline-nni-pw基本属性
     * 
     * @param elementBusiElineNnipw1 网元-业务-eline-nni-pw基本属性
     * @return 结果
     */
    @Override
    public int updateElementBusiElineNnipw1(ElementBusiElineNnipw1 elementBusiElineNnipw1)
    {
        elementBusiElineNnipw1.setUpdateBy(SecurityUtils.getUsername());
        elementBusiElineNnipw1.setUpdateTime(DateUtils.getNowDate());
        return elementBusiElineNnipw1Mapper.updateElementBusiElineNnipw1(elementBusiElineNnipw1);
    }

    /**
     * 批量删除网元-业务-eline-nni-pw基本属性
     * 
     * @param ids 需要删除的网元-业务-eline-nni-pw基本属性主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiElineNnipw1ByIds(String[] ids)
    {
        return elementBusiElineNnipw1Mapper.deleteElementBusiElineNnipw1ByIds(ids);
    }

    /**
     * 删除网元-业务-eline-nni-pw基本属性信息
     * 
     * @param id 网元-业务-eline-nni-pw基本属性主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiElineNnipw1ById(String id)
    {
        return elementBusiElineNnipw1Mapper.deleteElementBusiElineNnipw1ById(id);
    }
}
